package cool.taomu.web.entity.echarts

import java.util.List
import org.eclipse.xtend.lib.annotations.Accessors

@Accessors
class Option {
	String backgroundColor = "#fff";
	Title title = new Title();
	Tooltip tooltip = new Tooltip;
	List<Series> series =  #[new Series];
	@Accessors
	static class Title{
		String text = "test";		
		String left= "center";
		int top = 0;
		Style textStyle = new Style;
		@Accessors
		static class Style{
			String color = "black";	
			String fontFamily = "黑体";
			int fontSize = 28;
		}
	}
	@Accessors
	static class Tooltip{
		String trigger = "item";
		String formatter = null;
	}
	@Accessors
	static class Series{
		String type = "treemap";
		List<String> center = #["50%","50%"];
		Label label = new Label;
		@Accessors
		static class Label{
			boolean show = true;	
			String formatter = null;
			String position = "inside";
			String color = "black";
			int fontSize = 14;
		}
		List<String> color = #["#FFC0CB","#D8BFDB","#B0C4DE"];
		List<Data> data = #[new Data];
		@Accessors
		static class Data{
			String name = "1";	
			int value = 1;
			List<Children> children=#[new Children("10",10),
				new Children("20",20),
				new Children("30",30)
			];
			@Accessors
			static class Children{
				String name = "1";	
				int value = 1;
				new(String name,int value){
					this.name = name;
					this.value = value;
				}
			}
		}
	}
}